Optimal. Leaf size=281 \[ -\frac {(8 A-14 B+9 C) \sinh ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right ) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}}{8 \sqrt {a} d}+\frac {\sqrt {2} (A-B+C) \tanh ^{-1}\left (\frac {\sqrt {a} \sqrt {\sec (c+d x)} \sin (c+d x)}{\sqrt {2} \sqrt {a+a \sec (c+d x)}}\right ) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}}{\sqrt {a} d}+\frac {C \sin (c+d x)}{3 d \cos ^{\frac {7}{2}}(c+d x) \sqrt {a+a \sec (c+d x)}}+\frac {(6 B-C) \sin (c+d x)}{12 d \cos ^{\frac {5}{2}}(c+d x) \sqrt {a+a \sec (c+d x)}}+\frac {(8 A-2 B+7 C) \sin (c+d x)}{8 d \cos ^{\frac {3}{2}}(c+d x) \sqrt {a+a \sec (c+d x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.63, antiderivative size = 281, normalized size of antiderivative = 1.00, number of steps
used = 9, number of rules used = 8, integrand size = 45, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.178, Rules used = {4350, 4173,
4106, 4108, 3893, 212, 3886, 221} \begin {gather*} \frac {(8 A-2 B+7 C) \sin (c+d x)}{8 d \cos ^{\frac {3}{2}}(c+d x) \sqrt {a \sec (c+d x)+a}}+\frac {\sqrt {2} (A-B+C) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)} \tanh ^{-1}\left (\frac {\sqrt {a} \sin (c+d x) \sqrt {\sec (c+d x)}}{\sqrt {2} \sqrt {a \sec (c+d x)+a}}\right )}{\sqrt {a} d}-\frac {(8 A-14 B+9 C) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)} \sinh ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a \sec (c+d x)+a}}\right )}{8 \sqrt {a} d}+\frac {(6 B-C) \sin (c+d x)}{12 d \cos ^{\frac {5}{2}}(c+d x) \sqrt {a \sec (c+d x)+a}}+\frac {C \sin (c+d x)}{3 d \cos ^{\frac {7}{2}}(c+d x) \sqrt {a \sec (c+d x)+a}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 221
Rule 3886
Rule 3893
Rule 4106
Rule 4108
Rule 4173
Rule 4350
Rubi steps
\begin {align*} \int \frac {A+B \sec (c+d x)+C \sec ^2(c+d x)}{\cos ^{\frac {5}{2}}(c+d x) \sqrt {a+a \sec (c+d x)}} \, dx &=\left (\sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \frac {\sec ^{\frac {5}{2}}(c+d x) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx\\ &=\frac {C \sin (c+d x)}{3 d \cos ^{\frac {7}{2}}(c+d x) \sqrt {a+a \sec (c+d x)}}+\frac {\left (\sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \frac {\sec ^{\frac {5}{2}}(c+d x) \left (\frac {1}{2} a (6 A+5 C)+\frac {1}{2} a (6 B-C) \sec (c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx}{3 a}\\ &=\frac {C \sin (c+d x)}{3 d \cos ^{\frac {7}{2}}(c+d x) \sqrt {a+a \sec (c+d x)}}+\frac {(6 B-C) \sin (c+d x)}{12 d \cos ^{\frac {5}{2}}(c+d x) \sqrt {a+a \sec (c+d x)}}+\frac {\left (\sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \frac {\sec ^{\frac {3}{2}}(c+d x) \left (\frac {3}{4} a^2 (6 B-C)+\frac {3}{4} a^2 (8 A-2 B+7 C) \sec (c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx}{6 a^2}\\ &=\frac {C \sin (c+d x)}{3 d \cos ^{\frac {7}{2}}(c+d x) \sqrt {a+a \sec (c+d x)}}+\frac {(6 B-C) \sin (c+d x)}{12 d \cos ^{\frac {5}{2}}(c+d x) \sqrt {a+a \sec (c+d x)}}+\frac {(8 A-2 B+7 C) \sin (c+d x)}{8 d \cos ^{\frac {3}{2}}(c+d x) \sqrt {a+a \sec (c+d x)}}+\frac {\left (\sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \frac {\sqrt {\sec (c+d x)} \left (\frac {3}{8} a^3 (8 A-2 B+7 C)-\frac {3}{8} a^3 (8 A-14 B+9 C) \sec (c+d x)\right )}{\sqrt {a+a \sec (c+d x)}} \, dx}{6 a^3}\\ &=\frac {C \sin (c+d x)}{3 d \cos ^{\frac {7}{2}}(c+d x) \sqrt {a+a \sec (c+d x)}}+\frac {(6 B-C) \sin (c+d x)}{12 d \cos ^{\frac {5}{2}}(c+d x) \sqrt {a+a \sec (c+d x)}}+\frac {(8 A-2 B+7 C) \sin (c+d x)}{8 d \cos ^{\frac {3}{2}}(c+d x) \sqrt {a+a \sec (c+d x)}}+\left ((A-B+C) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \frac {\sqrt {\sec (c+d x)}}{\sqrt {a+a \sec (c+d x)}} \, dx-\frac {\left ((8 A-14 B+9 C) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \sqrt {\sec (c+d x)} \sqrt {a+a \sec (c+d x)} \, dx}{16 a}\\ &=\frac {C \sin (c+d x)}{3 d \cos ^{\frac {7}{2}}(c+d x) \sqrt {a+a \sec (c+d x)}}+\frac {(6 B-C) \sin (c+d x)}{12 d \cos ^{\frac {5}{2}}(c+d x) \sqrt {a+a \sec (c+d x)}}+\frac {(8 A-2 B+7 C) \sin (c+d x)}{8 d \cos ^{\frac {3}{2}}(c+d x) \sqrt {a+a \sec (c+d x)}}-\frac {\left (2 (A-B+C) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \text {Subst}\left (\int \frac {1}{2 a-x^2} \, dx,x,-\frac {a \sqrt {\sec (c+d x)} \sin (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{d}+\frac {\left ((8 A-14 B+9 C) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {1+\frac {x^2}{a}}} \, dx,x,-\frac {a \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{8 a d}\\ &=-\frac {(8 A-14 B+9 C) \sinh ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right ) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}}{8 \sqrt {a} d}+\frac {\sqrt {2} (A-B+C) \tanh ^{-1}\left (\frac {\sqrt {a} \sqrt {\sec (c+d x)} \sin (c+d x)}{\sqrt {2} \sqrt {a+a \sec (c+d x)}}\right ) \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}}{\sqrt {a} d}+\frac {C \sin (c+d x)}{3 d \cos ^{\frac {7}{2}}(c+d x) \sqrt {a+a \sec (c+d x)}}+\frac {(6 B-C) \sin (c+d x)}{12 d \cos ^{\frac {5}{2}}(c+d x) \sqrt {a+a \sec (c+d x)}}+\frac {(8 A-2 B+7 C) \sin (c+d x)}{8 d \cos ^{\frac {3}{2}}(c+d x) \sqrt {a+a \sec (c+d x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.22, size = 154, normalized size = 0.55 \begin {gather*} \frac {2 \cos \left (\frac {1}{2} (c+d x)\right ) \left ((A-B+C) \tanh ^{-1}\left (\sin \left (\frac {1}{2} (c+d x)\right )\right )+\frac {1}{48} \left (-3 \sqrt {2} (8 A-14 B+9 C) \tanh ^{-1}\left (\sqrt {2} \sin \left (\frac {1}{2} (c+d x)\right )\right )+2 \sec (c+d x) \left (3 (8 A-2 B+7 C)+2 (6 B-C) \sec (c+d x)+8 C \sec ^2(c+d x)\right ) \sin \left (\frac {1}{2} (c+d x)\right )\right )\right )}{d \sqrt {\cos (c+d x)} \sqrt {a (1+\sec (c+d x))}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(637\) vs.
\(2(236)=472\).
time = 0.18, size = 638, normalized size = 2.27
method | result | size |
default | \(\frac {\left (-1+\cos \left (d x +c \right )\right ) \sqrt {\frac {a \left (1+\cos \left (d x +c \right )\right )}{\cos \left (d x +c \right )}}\, \left (24 A \arctan \left (\frac {\sqrt {-\frac {2}{1+\cos \left (d x +c \right )}}\, \left (-1-\cos \left (d x +c \right )+\sin \left (d x +c \right )\right ) \sqrt {2}}{4}\right ) \sqrt {2}\, \left (\cos ^{3}\left (d x +c \right )\right )+24 A \arctan \left (\frac {\sqrt {-\frac {2}{1+\cos \left (d x +c \right )}}\, \left (1+\cos \left (d x +c \right )+\sin \left (d x +c \right )\right ) \sqrt {2}}{4}\right ) \sqrt {2}\, \left (\cos ^{3}\left (d x +c \right )\right )-42 B \arctan \left (\frac {\sqrt {-\frac {2}{1+\cos \left (d x +c \right )}}\, \left (-1-\cos \left (d x +c \right )+\sin \left (d x +c \right )\right ) \sqrt {2}}{4}\right ) \sqrt {2}\, \left (\cos ^{3}\left (d x +c \right )\right )-42 B \arctan \left (\frac {\sqrt {-\frac {2}{1+\cos \left (d x +c \right )}}\, \left (1+\cos \left (d x +c \right )+\sin \left (d x +c \right )\right ) \sqrt {2}}{4}\right ) \sqrt {2}\, \left (\cos ^{3}\left (d x +c \right )\right )+27 C \arctan \left (\frac {\sqrt {-\frac {2}{1+\cos \left (d x +c \right )}}\, \left (-1-\cos \left (d x +c \right )+\sin \left (d x +c \right )\right ) \sqrt {2}}{4}\right ) \sqrt {2}\, \left (\cos ^{3}\left (d x +c \right )\right )+27 C \arctan \left (\frac {\sqrt {-\frac {2}{1+\cos \left (d x +c \right )}}\, \left (1+\cos \left (d x +c \right )+\sin \left (d x +c \right )\right ) \sqrt {2}}{4}\right ) \sqrt {2}\, \left (\cos ^{3}\left (d x +c \right )\right )-48 A \sqrt {-\frac {2}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right ) \left (\cos ^{2}\left (d x +c \right )\right )-96 A \arctan \left (\frac {\sin \left (d x +c \right ) \sqrt {-\frac {2}{1+\cos \left (d x +c \right )}}}{2}\right ) \left (\cos ^{3}\left (d x +c \right )\right )+12 B \sqrt {-\frac {2}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right ) \left (\cos ^{2}\left (d x +c \right )\right )+96 B \arctan \left (\frac {\sin \left (d x +c \right ) \sqrt {-\frac {2}{1+\cos \left (d x +c \right )}}}{2}\right ) \left (\cos ^{3}\left (d x +c \right )\right )-42 C \sqrt {-\frac {2}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right ) \left (\cos ^{2}\left (d x +c \right )\right )-96 C \arctan \left (\frac {\sin \left (d x +c \right ) \sqrt {-\frac {2}{1+\cos \left (d x +c \right )}}}{2}\right ) \left (\cos ^{3}\left (d x +c \right )\right )-24 B \sqrt {-\frac {2}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right ) \cos \left (d x +c \right )+4 C \sqrt {-\frac {2}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right ) \cos \left (d x +c \right )-16 C \sqrt {-\frac {2}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right )\right )}{48 d a \sqrt {-\frac {2}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right )^{2} \cos \left (d x +c \right )^{\frac {5}{2}}}\) | \(638\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 5590 vs.
\(2 (236) = 472\).
time = 0.93, size = 5590, normalized size = 19.89 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.69, size = 680, normalized size = 2.42 \begin {gather*} \left [\frac {4 \, {\left (3 \, {\left (8 \, A - 2 \, B + 7 \, C\right )} \cos \left (d x + c\right )^{2} + 2 \, {\left (6 \, B - C\right )} \cos \left (d x + c\right ) + 8 \, C\right )} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sqrt {\cos \left (d x + c\right )} \sin \left (d x + c\right ) + 3 \, {\left ({\left (8 \, A - 14 \, B + 9 \, C\right )} \cos \left (d x + c\right )^{4} + {\left (8 \, A - 14 \, B + 9 \, C\right )} \cos \left (d x + c\right )^{3}\right )} \sqrt {a} \log \left (\frac {a \cos \left (d x + c\right )^{3} + 4 \, \sqrt {a} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} {\left (\cos \left (d x + c\right ) - 2\right )} \sqrt {\cos \left (d x + c\right )} \sin \left (d x + c\right ) - 7 \, a \cos \left (d x + c\right )^{2} + 8 \, a}{\cos \left (d x + c\right )^{3} + \cos \left (d x + c\right )^{2}}\right ) + \frac {48 \, \sqrt {2} {\left ({\left (A - B + C\right )} a \cos \left (d x + c\right )^{4} + {\left (A - B + C\right )} a \cos \left (d x + c\right )^{3}\right )} \log \left (-\frac {\cos \left (d x + c\right )^{2} - \frac {2 \, \sqrt {2} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sqrt {\cos \left (d x + c\right )} \sin \left (d x + c\right )}{\sqrt {a}} - 2 \, \cos \left (d x + c\right ) - 3}{\cos \left (d x + c\right )^{2} + 2 \, \cos \left (d x + c\right ) + 1}\right )}{\sqrt {a}}}{96 \, {\left (a d \cos \left (d x + c\right )^{4} + a d \cos \left (d x + c\right )^{3}\right )}}, -\frac {48 \, \sqrt {2} {\left ({\left (A - B + C\right )} a \cos \left (d x + c\right )^{4} + {\left (A - B + C\right )} a \cos \left (d x + c\right )^{3}\right )} \sqrt {-\frac {1}{a}} \arctan \left (\frac {\sqrt {2} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sqrt {-\frac {1}{a}} \sqrt {\cos \left (d x + c\right )}}{\sin \left (d x + c\right )}\right ) - 2 \, {\left (3 \, {\left (8 \, A - 2 \, B + 7 \, C\right )} \cos \left (d x + c\right )^{2} + 2 \, {\left (6 \, B - C\right )} \cos \left (d x + c\right ) + 8 \, C\right )} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sqrt {\cos \left (d x + c\right )} \sin \left (d x + c\right ) + 3 \, {\left ({\left (8 \, A - 14 \, B + 9 \, C\right )} \cos \left (d x + c\right )^{4} + {\left (8 \, A - 14 \, B + 9 \, C\right )} \cos \left (d x + c\right )^{3}\right )} \sqrt {-a} \arctan \left (\frac {2 \, \sqrt {-a} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sqrt {\cos \left (d x + c\right )} \sin \left (d x + c\right )}{a \cos \left (d x + c\right )^{2} - a \cos \left (d x + c\right ) - 2 \, a}\right )}{48 \, {\left (a d \cos \left (d x + c\right )^{4} + a d \cos \left (d x + c\right )^{3}\right )}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: SystemError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int \frac {A+\frac {B}{\cos \left (c+d\,x\right )}+\frac {C}{{\cos \left (c+d\,x\right )}^2}}{{\cos \left (c+d\,x\right )}^{5/2}\,\sqrt {a+\frac {a}{\cos \left (c+d\,x\right )}}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________